package com.fanrui.code.gate.client;

import com.fanrui.proto.cmd.ServerCmdWrapper;

public class GameServerClient {
	//singleton
	private GameServerClient() {
	}

	private static class GamerServerClientSingleton {
		private static GameServerClient instance = new GameServerClient();
	}

	public static GameServerClient getInstance() {
		return GamerServerClientSingleton.instance;
	}
	
	private OtherServerClient client = null;
	
	public void load(String ip,int port){
		client = new OtherServerClient(ip,port);
	}
	
	public void sendRequest(ServerCmdWrapper msg) {
		try {
			client.getConnect().writeAndFlush(msg);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
